package com.example.twoscroolview.activity

import android.animation.ObjectAnimator
import android.os.Bundle
import android.os.Handler
import androidx.appcompat.app.AppCompatActivity
import com.example.twoscroolview.R
import kotlinx.android.synthetic.main.activity_indator.*
import java.util.*

/**
 * 渐变指示器
 */
class IndatorActivity:AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_indator)
        startAnimator()
    }

    fun startAnimator(){
       val handle  =  Handler()
        handle.postDelayed(Runnable {
                                  ObjectAnimator.ofFloat(simpleColorChangeTextView,"percent",0f,1f)
                                      .setDuration(5000)
                                      .start()
        },2000)
    }
}